<?php

namespace App\Http\Controllers\Api;

use App\Models\HotSearchs;
use App\Models\Activitys;
use App\Models\Ads;
use App\Models\Buys;
use App\Models\Collections;
use App\Models\Configs;
use App\Models\Footprints;
use App\Models\IntegralLogs;
use App\Models\SignUps;
use App\Models\Users;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SearchController extends Controller
{
    /**
     * 热门搜索
     * @route api.act.actCate
     */
    public function hotList(Request $request){
        try{
            $params = [
              'content' => trim($request->params('content',1)),
              'count' => 1,
              'type' => intval($request->params('type',1)),
              'status' => 1
            ];
            $limit = intval($request->params('limit',6));
            $lists = HotSearchs::getList($params, ['content'], $limit);

            return response()->json([
                "code" => 1,
                "msg" => "获取成功",
                "data" => $lists
            ]);
        }catch (\Exception $e){
            return response()->json(["code"=>0, "msg"=>$e->getMessage()]);
        }
    }


}